package com.qlhx.controller;


import com.qlhx.common.model.DataGridResult;
import com.qlhx.model.AdminRole;
import com.qlhx.model.AdminUser;
import com.qlhx.mybatis.page.Pagination;
import com.qlhx.service.AdminRoleService;
import com.qlhx.service.AdminUserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(maxAge = 3600)
@RestController
@Scope(value = "prototype")
@RequestMapping("adminUser")
public class AdminUserController {

    @Autowired
    private AdminUserService adminuserservice;

    
    @RequestMapping(value = "list", method = RequestMethod.POST ,produces = { "application/json" })
	public @ResponseBody DataGridResult list(ModelMap modelMap, Integer offset, Integer limit,@RequestHeader String token) {
		Pagination<AdminUser> list = adminuserservice.findAll(modelMap, offset, limit);
		DataGridResult r = new DataGridResult();
		r.setTotal(list.getTotalCount());
		r.setRows(list.getList());
		return r;
	}
    
    
}
